#ifndef AmqpException_h__
#define AmqpException_h__
#include "amqp.h"



#include <stdexcept>
#include <string>

struct amqp_rpc_reply_t_;
class AMQPException : public std::exception {
	std::string message;
	int code;
public:
	explicit AMQPException(std::string message);
	explicit AMQPException(amqp_rpc_reply_t * res);

	AMQPException(std::string action, int error_code);

	virtual ~AMQPException() throw() {}

	std::string   getMessage() const;
	uint16_t getReplyCode() const;

	virtual const char* what() const throw () {
		return message.c_str();
	}
};

#endif // AmqpException_h__
